package com.qfedu.shopcatdel.service.Impl;

import com.qfedu.shopcatdel.dao.ShopcatMapper;
import com.qfedu.shopcatdel.service.ShopcatDelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ShopcatDelServiceImpl implements ShopcatDelService {

    @Autowired
    private ShopcatMapper shopcatMapper;

    @Override
    public int deleteShopcat(String cids) {
        int j = 1;
        String[] arr = cids.split(",");
        for (int i = 0; i < arr.length; i++) {
            int cid = Integer.parseInt(arr[i]);
            shopcatMapper.deleteByPrimaryKey(cid);
            j *= i;
        }
        return j;
    }
}
